package com.huawei.appgallery.forum.base.ui;

import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import com.huawei.appgallery.forum.base.api.IJGWTabProtocol;
import com.huawei.hmf.annotation.FragmentDefine;
import com.huawei.secure.android.common.intent.SafeBroadcastReceiver;
import o.bqx;
import o.brv;
import o.bsn;
import o.cia;
import o.ContentManager;
import o.fjm;
import o.ll;

@FragmentDefine(alias = "JGWTabFragment", protocol = IJGWTabProtocol.class)
public class JGWTabFragment extends ForumFragment {
    protected fjm ﹳ = fjm.ॱ(this);
    private SafeBroadcastReceiver ﾞ = new SafeBroadcastReceiver(this) {
        final /* synthetic */ JGWTabFragment ˏ;

        {
            this.ˏ = r1;
        }

        public void onReceiveMsg(Context context, Intent intent) {
            if (context == null || intent == null || this.ˏ.ͺˎ == null) {
                bqx.ॱ("JGWTabFragment", "onReceive, context = " + context + ", intent = " + intent + ", listView = " + this.ˏ.ͺˎ);
                return;
            }
            String action = intent.getAction();
            Bundle extras;
            if (bsn.ˊ.equals(action)) {
                extras = intent.getExtras();
                if ((this.ˏ.י instanceof brv) && extras != null) {
                    this.ˏ.ˊॱ(extras.getString("cardId"));
                }
            } else if ("com.huawei.appgallery.forum.posts.deletecomment".equals(action)) {
                extras = intent.getExtras();
                if ((this.ˏ.י instanceof brv) && extras != null) {
                    this.ˏ.ˊॱ(this.ˏ.ˊ(extras.getLong("comment_id")));
                }
            }
        }
    };

    public void ˏ(Bundle bundle) {
        if (getClass().getAnnotation(FragmentDefine.class) != null) {
            Object ॱ = this.ﹳ.ॱ();
            if (ॱ != null && (ॱ instanceof IJGWTabProtocol)) {
                IJGWTabProtocol iJGWTabProtocol = (IJGWTabProtocol) ॱ;
                this.ﾟ = iJGWTabProtocol.getDomainId();
                this.ʹ = iJGWTabProtocol.getIsDelayShowLoading();
                this.ʼ.ˏ(this.ﾟ);
                ॱˊ(iJGWTabProtocol.getNoObserverAccount());
                this.ʼˊ = iJGWTabProtocol.getUri();
            }
        }
        super.ˏ(bundle);
    }

    protected void ॱॱ(String str) {
        this.ʼ.ॱ(str);
    }

    public cia ˊ(Context context) {
        return new brv(context);
    }

    public void ˌॱ() {
        super.ˌॱ();
        IntentFilter intentFilter = new IntentFilter(bsn.ˊ);
        intentFilter.addAction("com.huawei.appgallery.forum.posts.deletecomment");
        ll.ˏ(ContentManager.getInstant().getContext()).ˏ(this.ﾞ, intentFilter);
    }

    public void ˋʼ() {
        super.ˋʼ();
        ll.ˏ(ContentManager.getInstant().getContext()).ˋ(this.ﾞ);
    }

    private void ˊॱ(String str) {
        if (((brv) this.י).ॱ(str)) {
            int ˊॱ = this.י.ˊॱ();
            if (ꜝ() > 1 || ˊॱ != 0) {
                this.י.ͺ();
                return;
            }
            ˋॱ(false);
            bqx.ˊ("JGWTabFragment", "show noDataView, provider is empty");
        }
    }

    private String ˊ(long j) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(2).append("_").append(j);
        return stringBuilder.toString();
    }
}
